﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web
{
    public partial class WebMyAddress : FromentWebCommon
    {
        public List<Model.tb_address> list = new List<Model.tb_address>();
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (!Page.IsPostBack)
            {
                if (string.IsNullOrEmpty(Common.UICookie.ReadCookie("ClientUId")))
                {
                    Response.Write("<script>alert('请先登录！');window.location.href='default.aspx';</script>");
                }
                else
                {
                    int cid = Convert.ToInt32(Common.UICookie.ReadCookie("ClientUId"));
                    var umodel = Common.SqlExption.GetList<Model.tb_user>().FirstOrDefault(c => c.Id.Equals(cid));
                    list = Common.SqlExption.GetList<Model.tb_address>() .Where(c => c.user_number.Equals(umodel.user_number)).ToList();
                }
            }
        }
      
    }
}